# Contributor: Bjoern Schilberg <bjoern@intevation.de>
# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=postgis
pkgver=3.4.0
pkgrel=3
pkgdesc="spatial database extender for PostgreSQL object-relational database"
url="https://postgis.net/"
arch="all"
license="GPL-2.0-or-later"
depends="perl"
makedepends="
	gdal-dev
	geos-dev
	json-c-dev
	libxml2-dev
	pcre2-dev
	perl-dev
	postgresql-dev
	proj-dev
	protobuf-c-dev
	sfcgal-dev
	"
subpackages="$pkgname-doc"
source="https://download.osgeo.org/postgis/source/postgis-$pkgver.tar.gz"
options="!check" # tests depends on a running PostgreSQL server

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

package() {
	depends="$depends postgresql$(pg_config --major-version)"

	make DESTDIR="$pkgdir" install
}

sha512sums="
d8c5329e5394bfe1d77a207d35cf8100217d39236cfeb228e268c796e16e24068df2191403830bf190b7ae9fabb21003675a091a8cc6dbfeed9b4b02cbbb9d33  postgis-3.4.0.tar.gz
"
